<!DOCTYPE html>
<html lang="en">

<head>
    <title></title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <script src="./lib/vue-2.4.0.js"></script>
</head>

<body>
    <div id="app">

        <!-- //父组件中引用子组件 -->
        <com1 :fmsg='msg'>45</com1>
    </div>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                msg: '父元素中的数据'
            },
            methods: {

            },
            components: {
                com1: {
                    data() {
                        return {
                            ppp: '111',
                            contrl: 'ddd',
                            ss:null
                        }
                    }, 
                    template: '<h3 @click="change">  这是子组件---{{fmsg}}----{{ss}}</h3>',
                    props: ['fmsg'],
                    methods:{

                        change(){
                            this.ss = this.fmsg;
                        }
                    },
                    mounted(){
                        this.ss = this.fmsg
                        console.log(this.ss);
                        
                    }
                },



            }
        })
    </script>
</body>

</html>